package com.hui.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import javax.persistence.Id;
import java.io.Serializable;

/**
 * (Product)实体类
 *
 * @author makejava
 * @since 2021-09-26 08:18:06
 */
@AllArgsConstructor
@NoArgsConstructor
@ToString
@Data
@TableName("product")
@Document(indexName = "hui",type = "product",shards = 1,replicas = 1)
public class Product implements Serializable {
    private static final long serialVersionUID = 969560428149798012L;
    @TableId(type = IdType.AUTO)
    @Id
    private Integer id;

    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String name;

    @Field(type = FieldType.Float, index = false)
    private Float price;

    @Field(type = FieldType.Integer, index = false)
    private Integer flag;

    @Field(type = FieldType.Text, index = false)
    private String images;

    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String goodsDesc;

    @Field(type = FieldType.Integer, index = false)
    private Integer goodsStock;

    @Field(type = FieldType.Text)
    private String goodsType;

}

